package com.igoal.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.dao.DataAccessException;
import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UserDetailsService;
import org.springframework.security.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import com.igoal.dao.UserDAOExt;

@Service("customUserDetailsService")
public class UserDetailsServiceImpl implements UserDetailsService {
	@Qualifier("userDAOExt")
	private UserDAOExt userDAOExt;
	
	@Autowired
    public void setUserDAOExt(UserDAOExt userDAOExt) {
        this.userDAOExt = userDAOExt;        
    }
	
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException, DataAccessException {
		return userDAOExt.loadUserByUsername(username);
	}

}
